<template>
    <div class="fenlei">
        <!-- 标题 -->
        <h1 class="title">李有财</h1>
        <!-- 搜索 -->
        <div class="search">
            <div class="search-item">
                <van-icon name="search" class="search-icon"></van-icon>
                <span class="search-text">搜索</span>
            </div>
        </div>
        <!-- 主体部分 -->
        <div class="main">
            <div class="main-left">
                <SlideBar @emitData="getData"></SlideBar>
            </div>
            <div class="main-right">
                <GoodsList :fenleiList="fenleiList"></GoodsList>
            </div>
        </div>
    </div>
</template>

<script>
import SlideBar from "../components/fenlei/SlideBar.vue"
import GoodsList from "../components/fenlei/GoodsList.vue"

export default {
    name:"FenLei",
    components:{
        SlideBar,
        GoodsList
    },
    data() {
        return {
            fenleiList:[]
        }
    },
    methods:{
        getData(v){
            this.fenleiList = v.children
            console.log(v)
        }
    }
}
</script>

<style scoped lang="less">
    .title{
        width:100vw;
        height:50px;
        background: #EB4450;
        color:white;
        text-align: center;
        line-height:50px;
    }
    .search{
        background:#EB4450;
        height:40px;
        width: 100vw;
        padding: 10px 0 0;
        .search-item{
            width: 90vw;
            margin: 0 auto;
            height: 30px;
            background:white;
            text-align: center;
            color:#999;
            line-height: 30px;
            border-radius: 3px;
        }
    }
    .main{
        width: 100vw;
        height: calc(100vh - 100px);
        // background: #f00;
        display:flex;
        .main-left{
            width: 100px;
            // background: rgb(107, 189, 204);
        }
        .main-right{
            flex: 1;
            // background:greenyellow;
        }
    }
</style>